package com.factory._04single;

/**
 * 懒汉式单例
 *
 * @author Qinye
 * @date 2023/8/11 21:31
 */
public class LazySingleTon {
    private LazySingleTon() {
    }

    private static LazySingleTon lazySingleTon = null;

     public static LazySingleTon getInstance() {
         synchronized(LazySingleTon.class){
             if (lazySingleTon == null) {
                 //noinspection InstantiationOfUtilityClass
                 lazySingleTon = new LazySingleTon();
             }
             return lazySingleTon;
         }

    }
}
